# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=anewer
pkgver=0.1.6
pkgrel=1
pkgdesc="anewer appends lines from stdin to a file if they don't already exist in the file"
url='https://github.com/ysf/anewer'
arch=('loong64' 'x86_64')
license=('GPL3')
makedepends=('cargo')
source=(https://github.com/ysf/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
b2sums=('b6a65f94b5d57ecd7947c75dda57c8c1166c94b2677a6fe25bf1fede8af49e4546429f356883b4dc5ac5b5f599efed7c991b6e7d7549c29de333e6fdff00e6aa')

prepare() {
  cd "${pkgname}-${pkgver}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd ${pkgname}-${pkgver}
  cargo build --frozen --release
}

check() {
  cd ${pkgname}-${pkgver}
  cargo test --frozen
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 755 -t "${pkgdir}/usr/bin" \
    target/release/anewer
}

# vim: ts=2 sw=2 et:
